﻿using System;
using CustomerContactSystem.Core.Model;

namespace CustomerContactSystem.WebForms.Admin.Classifications {
    public partial class Create : BasePage {

        protected void Page_Load(object sender, EventArgs e) {
        }

        protected void CreateNewClassificationClick(object sender, EventArgs e) {
            var classification = new EnquiryClassification
                {
                    Classification = ClassificationName.Text
                };

            if (!IsValidObject(classification, CreateNewClassificationResultMessage)) {
                return;
            }

            EnquiryClassificationRepository.Add(classification);
            
            Response.Redirect("~/Admin/Classifications/List.aspx");
        }
    }
}